﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SanPham.ascx.cs" Inherits="XLDL.Admin.SanPham"  EnableViewState="true"  %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit.HTMLEditor" tagprefix="cc1" %>
<%@ Register TagPrefix="cc1" Namespace="SiteUtils" Assembly="CollectionPager" %>
            <style type="text/css">
                .style1
                {
                    width: 100px;
                }
                </style>
            <%--<asp:UpdatePanel ID="Up_p2" runat="server" >
                    <ContentTemplate>--%>
           <asp:ScriptManager ID="ScriptManager1" runat="server">
                 </asp:ScriptManager>
    <table cellspacing="1">
        <tr align="center">
            <td align="left" width="150px">
                &nbsp;</td>
            <td align="left" width="220">
                <span style="font-weight:bold">SẢN PHẨM</span></td>
                               
        </tr>
        <tr>        <td align="left" width="150px">
                Ngày đăng:</td>
            <td align="left">
                <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                                <asp:TextBox ID="txt_ngaydang" runat="server" Width="100px" ReadOnly="True"></asp:TextBox>
                              
                   </ContentTemplate>
                   <Triggers>
                   <asp:AsyncPostBackTrigger ControlID="lich" EventName="SelectionChanged" /> 
                 
                   </Triggers>

                    </asp:UpdatePanel>      
                 </td>
            <td align="left" width="120px">
                &nbsp;</td>
            <td>
            <asp:UpdatePanel ID="UpdatePanel4" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                <asp:TextBox ID="txt_ngaycapnhat" runat="server" Width="100px" Visible="False"></asp:TextBox>
                </ContentTemplate>
                   <Triggers>
                   <asp:AsyncPostBackTrigger ControlID="lich" EventName="SelectionChanged" />
                 
                   </Triggers>

                    </asp:UpdatePanel>   
                </td>
            
            <td align="left" rowspan="9" valign="top" style="font-weight: 700">
            <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
                <asp:Calendar ID="lich" runat="server" BackColor="White" 
                    BorderColor="#999999" CellPadding="4" DayNameFormat="Shortest" 
                    Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" Height="180px" 
                    Width="200px" onselectionchanged="lich_SelectionChanged">
                    <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                    <SelectorStyle BackColor="#CCCCCC" />
                    <WeekendDayStyle BackColor="#FFFFCC" />
                    <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                    <OtherMonthDayStyle ForeColor="#808080" />
                    <NextPrevStyle VerticalAlign="Bottom" />
                    <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                    <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                </asp:Calendar>
                </ContentTemplate>
                <Triggers><asp:AsyncPostBackTrigger ControlID= "lich" EventName="SelectionChanged"/>
              
                </Triggers>
                </asp:UpdatePanel>
            </td>
            
        </tr>
        <tr>
            <td align="left" width="150px">
                Tên sản phẩm:</td>
            <td align="left">
                <asp:TextBox ID="txt_tensp" runat="server" Width="200px"></asp:TextBox>
            </td>
            <td align="left" width="120px">
                Nhóm sản phẩm:</td>
            <td>
                <asp:DropDownList ID="Drop_nhomsp" runat="server" Width="155px">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td align="left" width="150px">
                Giới tính:</td>
            <td align="left">
                <asp:DropDownList ID="Drop_gioitinh" runat="server" Width="90px">
                    <asp:ListItem Value="1">Nữ</asp:ListItem>
                    <asp:ListItem Value="2">Nam</asp:ListItem>
                    <asp:ListItem Value="3">Đôi</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td align="left">
                Giá:</td>
            <td align="left">
                <asp:TextBox ID="txt_gia" runat="server" Width="150px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="left" width="150px">
                Tình trạng:</td>
            <td align="left">
                <asp:DropDownList ID="Drop_tinhtrang" runat="server" Width="90px">
                    <asp:ListItem Value="1">Còn hàng</asp:ListItem>
                    <asp:ListItem Value="0">Hết hàng</asp:ListItem>
                    <asp:ListItem Value="2">Sắp về</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td align="left">
                Mới cũ:</td>
            <td>
                <asp:DropDownList ID="Drop_moicu" runat="server" Width="90px">
                    <asp:ListItem Value="True">Mới</asp:ListItem>
                    <asp:ListItem Value="False">Cũ</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td align="left" width="150px">
                Hot:</td>
            <td align="left">
                <asp:DropDownList ID="Drop_hot" runat="server" Width="90px">
                    <asp:ListItem Value="False">False</asp:ListItem>
                    <asp:ListItem Value="True">True</asp:ListItem>
                </asp:DropDownList>
            </td>
            <td align="left">
                Hiển thị:</td>
            <td align="left">
                <asp:DropDownList ID="Drop_hienthi" runat="server" Width="90px">
                    <asp:ListItem Value="False">False</asp:ListItem>
                    <asp:ListItem Value="True">True</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td align="left" width="150px" valign="top">
                Mô tả:</td>
            <td colspan="3">
         <%--  </ContentTemplate>
           </asp:UpdatePanel>--%>
                <%--<asp:TextBox ID="txt_mota" runat="server" Height="100px" TextMode="MultiLine" 
                    Width="500px"></asp:TextBox>--%><asp:Button ID="open" runat="server" 
                    Text="+" onclick="open_Click" Width="30px" />
                <asp:UpdatePanel ID="up_editor" runat="server" UpdateMode="Conditional" 
                    Visible="False">
                    <ContentTemplate>
                    <cc1:Editor ID="mo_ta" runat="server" 
                    AutoFocus="False" Height="300px" TabIndex="3" Width="550px" />
                    </ContentTemplate>
                    <Triggers>
                    <asp:PostBackTrigger ControlID="open" />
                    </Triggers>
                     </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td align="left" width="150px" valign="top">
                Hình ảnh:</td>
            <td colspan="3">
            <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td valign="top" align="left" width="105">
                            <asp:Image ID="Image_hinh_anh" runat="server" ImageUrl="~/Images/Tao.jpg" 
                                 Width="100px" BorderStyle="None" 
                                ImageAlign="AbsMiddle" />
                        </td>
                        <td align="left" valign="middle" width="150">
                            <asp:Label ID="lbl_hinhanh" runat="server"></asp:Label>
                        </td>
                        <td align="left" valign="top">
                        
                      
                
                            <table cellpadding="1" cellspacing="1">
                                <tr>
                                    <td>
                                        <asp:FileUpload ID="fu_hinhanh" runat="server" />
                                    </td>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;</td>
                                </tr>
                            </table>
                
                
                        </td>
                        <td align="left" valign="top">
                                        <table cellspacing="1" class="style1">
                                            <tr>
                                                <td>
                                        <asp:Button ID="Button_them" runat="server" Text="Thêm" 
                                            onclick="Button_them_Click" />
                                                </td>
                                                <td>
                                        <asp:Button ID="Button_sua" runat="server" onclick="Button_sua_Click" 
                                            Text="Sửa" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                        <asp:Button ID="Button_xoa" runat="server" Text="Xoá" onclick="Button_xoa_Click" 
                                             />
                                                </td>
                                                <td>
                                                    &nbsp;</td>
                                            </tr>
                                            <tr>
                                                <td colspan="2">
                                        <asp:Button ID="Button_more" runat="server" Text="Thêm Size và Hình" 
                                            Width="120px" onclick="Button_more_Click" />
                                                </td>
                                            </tr>
                                        </table>
                                        <br />
                                    </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr align="center" valign="top">
            <td align="left" width="150px" valign="middle">
                Tìm kiếm:</td>
            <td align="left" colspan="3">
           
                <table cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="90" align="left">
                               <asp:TextBox ID="txt_tim" runat="server" ontextchanged="txt_tim_TextChanged" 
                                   Width="80px"></asp:TextBox></td>
                        <td align="left" valign="middle">                        
                <asp:DropDownList ID="Drop_timgt" runat="server" Width="90px" 
                                onselectedindexchanged="Drop_timgt_SelectedIndexChanged">
                    <asp:ListItem Value="all">Tất cả</asp:ListItem>
                    <asp:ListItem Value="Nữ">Nữ</asp:ListItem>
                    <asp:ListItem Value="Nam">Nam</asp:ListItem>
                    <asp:ListItem Value="Đôi">Đôi</asp:ListItem>
                    <asp:ListItem Value="1">Còn hàng</asp:ListItem>
                    <asp:ListItem Value="0">Hết hàng</asp:ListItem>
                    <asp:ListItem Value="2">Sắp về</asp:ListItem>
                    <asp:ListItem Value="False">Ẩn</asp:ListItem>
                    <asp:ListItem Value="True">Hiện</asp:ListItem>
                    <asp:ListItem Value="moi">Mới</asp:ListItem>
                    <asp:ListItem Value="cu">Cũ</asp:ListItem>
                    <asp:ListItem Value="hot">Hot</asp:ListItem>
                    
                </asp:DropDownList>
                        </td>
                        <td width="50px" align="center">
            <asp:Button ID="Button_tim" runat="server" Text="Tìm" onclick="Button_tim_Click" />
                        </td>
                        <td width="400px" align="left" valign="middle">
                            <asp:Label ID="lbl_tongcong" runat="server"></asp:Label>
                <asp:Label ID="lbl_id" runat="server" Visible="False"></asp:Label>&nbsp;</td>
                    </tr>
                </table>
           
            </td>
        </tr>
        
       
         <tr>
       
            <td align="center" width="150px" valign="top" colspan="4">
                <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
        
        <table>
        <tr><td><table><tr><td><div id="scroll_luoi">
         <asp:GridView ID="Luoi" runat="server" AutoGenerateColumns="False" 
                    onselectedindexchanging="Luoi_SelectedIndexChanging" Width="700px" 
                ondatabound="Luoi_DataBound" onrowcreated="Luoi_RowCreated" 
                onrowdatabound="Luoi_RowDataBound">
                    <Columns>
                        <asp:TemplateField HeaderText="ID">
                            <ItemTemplate>
                                <asp:Label ID="lbl_id" runat="server" Text='<%# Bind("id_sp") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="ngay_dang_sp" DataFormatString="{0: dd/MM/yyyy}" 
                            HeaderText="Ngày" />
                        <asp:BoundField DataField="ten_sp" HeaderText="Tên sản phẩm" />
                        <asp:BoundField DataField="gia_sp" HeaderText="Giá" 
                            DataFormatString="{0:#,##0}" />
                        <asp:BoundField DataField="gioi_tinh_sp" HeaderText="Giới tính" />
                        <asp:TemplateField HeaderText="Mới cũ">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("moi_cu") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbl_moicu" runat="server" Text='<%# Eval("moi_cu") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="hot" HeaderText="Hot" />
                        <asp:TemplateField HeaderText="Tình trạng">
                            <ItemTemplate>
                                <asp:Label ID="lbl_tinhtrang" runat="server" Text='<%# Bind("tinh_trang") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Hiển thị">
                            <ItemTemplate>
                                <asp:Label ID="lbl_ht" runat="server" Text='<%# Eval("hien_thi") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:CommandField ButtonType="Button" SelectText="Chọn" 
                            ShowSelectButton="True" />
                    </Columns>
                    <SelectedRowStyle BackColor="#CCCCCC" />
                   
                </asp:GridView>
        </div></td></tr></table>
           
             
             </td></tr>
         <tr><td align="center">
           <div>
<CC1:COLLECTIONPAGER id="CollectionPager1" runat="server" BackNextLocation="Split" 
        BackText="« Trước" NextText="Sau »" PageNumbersSeparator="&nbsp;" 
        PageNumbersStyle="PADDING-right:5px;PADDING-left:5px; text-decoration: none" 
        ResultsLocation="None" SectionPadding="10" ShowLabel="False" SliderSize="5" 
        UseSlider="True" LabelStyle="FONT-WEIGHT: bold; text-decoration: none;" 
        
        ResultsStyle="PADDING-BOTTOM:4px;PADDING-TOP:4px;FONT-WEIGHT: bold; text-decoration: none;" 
        HideOnSinglePage="False" IgnoreQueryString="False" 
        PagingMode="QueryString" FirstText="Đầu" LastText="Cuối" 
        ShowFirstLast="True" QueryStringKey="p">
         </CC1:COLLECTIONPAGER></div>
         </td></tr>
         </table>
                            
                </ContentTemplate>
                <Triggers>
                <asp:PostBackTrigger  ControlID="Luoi"/>   
                 </Triggers>
        </asp:UpdatePanel>
            </td>
            
        </tr>
        <tr>
            <td align="left" width="150px">
                &nbsp;</td>
            <td align="center" colspan="3">
                
         </td>
            <td align="center">
                
                &nbsp;</td>
        </tr>
       
        </table>
        
        <%--</ContentTemplate>
        <Triggers>
            <asp:PostBackTrigger  ControlID="Button_open" />
            </Triggers>
        </asp:UpdatePanel>--%>